package top.cdmrx.corncommon.handler;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import top.cdmrx.common.R;

/**
 * Created by Mr.陈 time on 2021/9/2 | 11:17
 **/
@ControllerAdvice
public class GlobExceptionHandler {

    @ExceptionHandler
    @ResponseBody
    public R error(Exception e){

        e.printStackTrace();
        return R.fail().message("产生了异常Q！！！");
    }
}
